<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp" %>
  <%@ include file="/WEB-INF/include/submenu.jsp" %>

  <div class="container-fluid ms-container has-ms-sidemenu">
  
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">车辆变更申报</li>
      
      <a href="javascript:window.history.back();" class="pull-right" style="margin-right: 10px;">
        <span class="glyphicon glyphicon-arrow-left"></span>&nbsp;返回
      </a>
    </ol>
  
    <div class="ms-content-layout">
  
      <form method="POST" action="${ctx.host}/tractors/${tractor.id}/change" class="form-horizontal ms-form modal-search-form" role="form" data-validate="true">
     
        <input type="hidden" name="versionId" value="${version.id}"/>
        
        <c:if test="${not empty errorMessage}">
          <div class="alert alert-danger"><i class="glyphicon glyphicon-remove"></i>${errorMessage}</div>
        </c:if> 
         
        <div class="form-horizontal ms-form form-personal-info">
        
          <div class="form-group ms-form-group">
             <label class="control-label col-xs-3"><span class="color-red">*</span>车辆状态：</label>
             <div class="col-xs-3 pull-left">
               <p class="form-control-static">${tractor.vehicleStatus.description}</p>
             </div>
           </div>

            <div class="form-group ms-form-group">
              <label class="control-label col-xs-3 "><span class="color-red">*</span>产证所有者：</label>
              <div class="col-xs-3 pull-left">
                <input type="text" name="floorLord" class="form-control" value="${tractor.floorLord}" placeholder="产证所有者" tabindex="2" autocomplete="off" data-validate="required"/>
              </div>
              
              <label class="control-label col-xs-2"><span class="color-red">*</span>车辆所属权：</label>
              <div class="col-xs-3 pull-left">
                <select class="select2 form-control" name="carOwnership" data-validate="required" tabindex="6">
                  <option value=""></option>
                  <c:forEach var="carOwnership" items="${enums['CarOwnership']}">
	                  <option value="${carOwnership}" ${carOwnership.alias == tractor.carOwnership.alias ? 'selected' : ''}>${carOwnership.description}</option>
	                </c:forEach>
                </select>
              </div>
            </div>

          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3"><span class="color-red">*</span>牵引车品牌：</label>
            <div class="col-xs-3 pull-left">
              <input type="text" name="brand" class="form-control" value="${tractor.brand}" placeholder="牵引车品牌" tabindex="5" autocomplete="off" data-validate="required"/>
            </div>
            
            <label class="control-label col-xs-2"><span class="color-red">*</span>牵引车VIN码：</label>
            <div class="col-xs-3 pull-left">
              <input type="text" name="vincode" class="form-control" value="${tractor.vincode}" placeholder="牵引车VIN码" tabindex="4" autocomplete="off" data-validate="required"/>
            </div>
          </div>
          
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3"><span class="color-red">*</span>牵引车马力：</label>
            <div class="col-xs-3 pull-left">
              <input type="text" name="horsepower" data-validate="required|number" class="form-control" placeholder="牵引车品牌" value="${tractor.horsepower}">
            </div>
            
            <label class="control-label col-xs-2"><span class="color-red">*</span>轴数：</label>
            <div class="col-xs-3 pull-left">
              <input type="text" name="axles" value="${tractor.axles}" data-validate="required|number" class="form-control" placeholder="轴数" tabindex="6" autocomplete="off" />
            </div>
          </div>
          
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3"><span class="color-red">*</span>发证日期：</label>
            <div class="col-xs-3 pull-left">
              <input type="text" name="issuingTime" class="form-control date" value="<fmt:formatDate value="${tractor.issuingTime}" pattern="yyyy-MM-dd"/>" placeholder="发证日期" data-validate="required" tabindex="6" autocomplete="off"/>
            </div>
          
            <label class="control-label col-xs-2"><span class="color-red">*</span>注册日期：</label>
            <div class="col-xs-3 pull-left">
              <input type="text" name="registrationTime" class="form-control date" value="<fmt:formatDate value="${tractor.registrationTime}" pattern="yyyy-MM-dd"/>" placeholder="发证日期" data-validate="required" tabindex="6" autocomplete="off"/>
            </div>
          </div>
          
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3"><span class="color-red">*</span>年检有效期至：</label>
            <div class="col-xs-3 pull-left">
              <input type="text" name="annualInspectionDate" data-validate="required" value="<fmt:formatDate value="${tractor.annualInspectionDate}" pattern="yyyy-MM"/>" class="form-control month" placeholder="年检有效期至" tabindex="5" autocomplete="off"/>
            </div>
            
            <label class="control-label col-xs-2"><span class="color-red">*</span>装载量：</label>
            <div class="col-xs-3 pull-left">
              <input type="text" name="trainload" data-validate="required|number" value="${tractor.trainload}" class="form-control" placeholder="装载量" tabindex="15" autocomplete="off" />
            </div>
          </div>
          
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3"><span class="color-red">*</span>车辆类型（行驶证）：</label>
            <div class="col-xs-3 pull-left">
              <select name="vehicleType" data-validate="required" class="select2 form-control">
                <option></option>
                <c:forEach var="vehicleType" items="${enums['TractorVehicleType']}">
                  <option value="${vehicleType}" ${tractor.vehicleType eq vehicleType ? 'selected' : ''}>${vehicleType.description}</option>
                </c:forEach>
              </select>
            </div>            
          </div>
          
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3"><span class="color-red">*</span>行驶证：</label>
            <div class="col-xs-3 pull-left">
              <div class="input-group">
                <iframe src="${config.uploadHost}?fileObject=TractorModifiedVersion&objectId=${version.id}&fileName=drivingLicense&acceptType=image" style="width: 100%; height: 26px; border: none;"></iframe>
                <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-primary big-close-up" data-imgsrc="${tractor.drivingLicense}">查看原图片</a>
              </div>
            </div>
            
            <label class="control-label col-xs-2"><span class="color-red">*</span>行驶证副本及检验页扫描件：</label>
            <div class="col-xs-3 pull-left">
              <div class="input-group">
                <iframe src="${config.uploadHost}?fileObject=TractorModifiedVersion&objectId=${version.id}&fileName=drivingLicenseCopy&acceptType=image" style="width: 100%; height: 26px; border: none;"></iframe>
                <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-primary big-close-up" data-imgsrc="${tractor.drivingLicenseCopy}">查看原图片</a>
              </div>
            </div>
          </div>
          
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3"><span class="color-red">*</span>车头45度照片：</label>
            <div class="col-xs-3 pull-left">
              <div class="input-group">
                <iframe src="${config.uploadHost}?fileObject=TractorModifiedVersion&objectId=${version.id}&fileName=vehiclePhoto&acceptType=image" style="width: 100%; height: 26px; border: none;"></iframe>
                <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-primary big-close-up" data-imgsrc="${tractor.vehiclePhoto}">查看原图片</a>
              </div>
            </div>
          
            <label class="control-label col-xs-2">购车合同：</label>
            <div class="col-xs-3 pull-left">
              <div class="input-group">
                <iframe src="${config.uploadHost}?fileObject=TractorModifiedVersion&objectId=${version.id}&fileName=vehicleContact" style="width: 100%; height: 26px; border: none;"></iframe>
                <a href="${tractor.vehicleContact}" download="${tractor.code}购车合同">原始合同下载</a>
              </div>
            </div>
          </div>
          
        </div>
        
        <div class="form-group ms-form-group">
          <div class="col-xs-6 col-xs-offset-3 ms-operation-group top-margin-20 text-center">
            <div class="col-xs-5">
              <button type="button" class="btn btn-block ms-btn-gray btn-go-back">取消</button>
            </div>
            <div class="col-xs-5">
              <button type="submit" class="btn btn-block btn-primary btn-submit">提交</button>
            </div>
          </div>
        </div>
  
      </form>
  
    </div>
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp" %>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/management/tractor/tractor-info-change.js"/>
  <script type="text/javascript">
    require(['page/supplier/management/tractor/tractor-info-change'], function (page) {
      page.init()
    })
  </script>

</body>
</html>